A digital camera uses an image sensor to convert an optical image received through a lens to electrical image sensor output data. To improve image quality, the black level of the image sensor output data is calibrated. Typically, the image sensor output data includes both valid pixel data and optical black (OB) pixel data. OB pixels are not illuminated pixels. The black level of the OB pixel data is first calibrated with respect to a desired black level and then used to correct the valid pixel data.
FIG. 1 (prior art) is a simplified block diagram of an analog front end (AFE) integrated circuit 11 having an analog black level calibration circuit. AFE integrated circuit 11 includes a correlated double sampling (CDS) circuit 21, a combining circuit 22, an analog programmable gain amplifier (PGA) 23, an analog-to-digital converter (ADC) 24, a digital offset circuit 25, an engine 26, an averaging circuit 27, a set of registers 28, and a digital-to-analog converter (DAC) 29. An analog image signal CCDOUT 12 is provided by an image sensor (for example, a charge coupled device (CCD) sensor) to CDS 21. CDS 21 samples the image signal CCDOUT 12 and outputs an output signal CDSOUT 13. CDSOUT 13 is combined with an analog feedback signal FB 19 to form a PGA input signal PGAIN 14. PGA 23 amplifies PGAIN 14 and outputs a PGA output signal PGAOUT 15. PGAOUT 15 is converted to a digital ADC output signal ADCOUT 16 and adjusted by digital offset circuit 25 for further digital image processing. For black level calibration, data values of ADCOUT 16 based on optical black (OB) pixels are averaged by averaging circuit 27. The averaged black level value is then stored in one of the sets of registers 28 and output as an average signal AVG 18. AVG 18 thus represents the black level of the OB pixels and is converted back to analog feedback signal FB 19 to be subtracted from CDSOUT 13. This analog domain feedback calibration method usually needs long settling time to result in an accurate black level. The analog calibration method may also cause undesirable image artifacts if there is noise in the OB pixels. Furthermore, it usually requires a high resolution DAC to create the feedback signal and thus introduces additional noise.
FIG. 2 (prior art) is a simplified block diagram of an analog front end (AFE) integrated circuit 31 having a digital black level calibration circuit 40. AFE 31 includes a correlated double sampling (CDS) circuit 41, an analog-to-digital converter (ADC) 42, purely digital black level calibration circuit 40, a digital programmable gain amplifier 45, and a serial interface port 46. CDS 41 receives an analog image signal CCDOUT 32. The analog image signal CCDOUT 32 is sampled by CDS 41 and digitized into a digital ADC output signal ADCOUT 33 by ADC 42. Black level calibrator 40 determines an optical black (OB) level 34. OB level 34 is subtracted from the incoming digital signal ADCOUT 33 to obtain a black level corrected data signal (OBAD) 35. OBAD signal 35 is then adjusted by a fixed OB adjustment (OBADJ) signal 36. OBADJ signal 36 is used for compensating the difference between the OB level and the black level of valid pixels. After black level adjustment, PGA 45 amplifies PGAIN signal 37 and outputs an amplified data signal PGAOUT 38 for further digital image processing. This digital domain calibration method is able to achieve fast single field calibration. However, the OB adjustment feature is difficult to use. Every time the PGA gain value is changed, the OB adjustment OBADJ must be changed accordingly. In addition, because all of the data buses are unsigned, the lowest value of OBAD 35 signal is clamped at zero, and there is no value below the OBADJ adjustment when a positive OBADJ signal 36 is applied. This clamping creates a dead zone in image data and reduces image quality.